package cn.tedu.luban.demand.webapi.consumer;

import cn.tedu.luban.demand.service.IRequestOrderService;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
@RocketMQMessageListener(
        topic = "${mq.topic.request-order-cancel-topic:request-order-cancel-topic}",
        consumerGroup = "${rocketmq.producer.group}")
public class OrderListener implements RocketMQListener<String> {

    @Autowired
    private IRequestOrderService requestOrderService;

    @Override
    public void onMessage(String requestOrderNo) {
        log.info("需求单-取消抢单:{}",requestOrderNo);
        requestOrderService.cancelGrabOrder(requestOrderNo);
    }
}








